package com.xiaowan.controller;

import com.xiaowan.dao.MenuMapper;
import com.xiaowan.dao.UserMapper;
import com.xiaowan.entity.Menu;
import com.xiaowan.entity.User;
import com.xiaowan.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    private UserService userService;

    @Resource
    private MenuMapper menuMapper;

    @Resource
    private UserMapper userMapper;

    @RequestMapping("/test")
    public User test(Integer id) {
        System.out.println("hello world!");
        return userMapper.selectById(id);
//        return userService.getUser(id);
    }

    @RequestMapping("/menu")
    public Menu getMenu(Integer id) {
        System.out.println("获取用户菜单");
        return menuMapper.selectById(id);
    }

}
